import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUserViewController } from '../../../controllers';
const uctoouserViewRouter = new Router();
const userViewController = new uctooUserViewController();

uctoouserViewRouter.post('/add', requireUser, userViewController.add);
uctoouserViewRouter.post('/edit', requireUser, rowLevelPermission('uctoo/user_view'), userViewController.edit);
uctoouserViewRouter.post('/del', requireUser, rowLevelPermission('uctoo/user_view'), userViewController.delete);

//For getting userView with permission control
uctoouserViewRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/user_view'), userViewController.getSingle);
uctoouserViewRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/user_view'), userViewController.getMany);
uctoouserViewRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/user_view'), userViewController.getMany);

//#endregion AutoCreateCode
export default uctoouserViewRouter;
